<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>CMS</title>
<link href="__CSS__/common.css" rel="stylesheet"/>
<link href="__CSS__/right.css" rel="stylesheet"/>
<link rel="stylesheet" href="__INC__/form/css/zebra_form.css" type="text/css">
<link rel="stylesheet" href="__INC__/kindeditor/themes/default/default.css"/>
<!--link rel="stylesheet" href="../kindeditor/plugins/code/prettify.css" /-->
<script type="text/javascript" language="javascript" src="__JS__/jquery-1.7.2.min.js"></script>
<script charset="utf-8" src="__INC__/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="__INC__/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="__INC__/kindeditor/plugins/code/prettify.js"></script>
<script charset="utf-8" src="__JS__/common.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $(".table_list tr").mouseover(function () {
            $(this).addClass("one");
        })
        $(".table_list tr").mouseout(function () {
            $(this).removeClass("one");
        })
    });
</script>
<style type="text/css">
    .one {
        background: #fcfcfc;
    }

    .lm_content {
        padding: 10px 0;
    }

    .Zebra_Form .row input.text {
        width: 100px;
        _width: 90px;
        _padding: 2px 10px 3px
    }

    .Zebra_Form .row input.button {
        width: 70px;
        _width: 60px;
        _padding: 2px 10px 3px;
        _height: 22px;
    }

    .Zebra_Form .row input.button2 {
        width: 45px;
        _width: 40px;
        _padding: 0 0 0;
        _overflow: hidden;
    }

    .Zebra_Form td {
        padding: 0 0 0 8px;
        _padding: 0 0 0 5px;
    }
</style>
</head>
<body>
<!--右侧区域 begin-->
<div class="right">
    <!--当前位置 begin-->
    <include file='common:crumbs'/>
    <!--当前位置 end-->
    <!--主体区域 begin-->
    <div class="container">
        <div class="alert_div">
            <h4 class="alert_info"><span class="welcome">{$welcome}</span>您现在的位置是：{$current} </h4>
            <h4 class="alert_what" style="display:none;"></h4>
        </div>

        <!--样式一 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l">
                    <em>操作面板</em>
                </div>
            </div>
            <div class="lm_content">
                <div id="panel">
                    <div class="infos_left">
                        <table class="Zebra_Form">
                            <tr class="row">
                                <td {$add_style}><input type="button" class="button" onclick="addcontent()" value="添加内容"/></td>
                                <td><input type="button" class="button" onclick="openpanel('del')" value="批量删除"/></td>
                                <form action='__GROUP__/ad/show' method="post">
                                    <input type="hidden" name="action" value="filter"></input>
                                    <td><label>搜索:</label></td>
                                    <td><select name="searchby">
                                        {$searchby_html}
                                    </select></td>
                                    <td colspan="2"><input type="text" name="searchkey" class="text"
                                                           value="{$searchkey}"/></td>
                                    <td><input type="submit" class="button button2" value="搜索"/></td>
                                    <td><label>排序:</label></td>
                                    <td><select name="orderby">
                                        {$orderby_html}
                                    </select></td>
                                    <td><input type="submit" class="button button2" value="排序"/></td>
                                </form>
                            </tr>
                        </table>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>

            <div class="lm_bottom">
                <div class="lm_bottom_l">
                    <em></em>
                </div>
            </div>
        </div>
        <!--样式一 end-->
        <!--样式二 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l">
                    <em>{$current}</em>
                </div>
            </div>
            <div class="lm_table">
                <table cellpadding="0" cellspacing="0" width="100%"
                       class="table_list">
                    <tr class="title" align="left">
                        <td>选择</td>
                        <td>广告号</td>
                        <td>广告标识</td>
                        <td>说明</td>
                        <td>投放范围</td>
                        <td>过期时间</td>
                        <td>状态</td>
                        <td>操作</td>
                    </tr>
                    <volist name='list' id='vo'>
                        <tr class="tr_line">
                            <td colspan="10">
                                <div></div>
                            </td>
                        </tr>
                        <tr align="left">
                            <td><input type="checkbox" name="_check[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.intro}</td>
                            <td>{:getArctypeName($vo['arctype'])}</td>
                            <td>{:overdue($vo['overdue'])}</td>
                            <td>{:status($vo['status'])}</td>
                            <td width="120px"><a href="__GROUP__/ad/edit?adid={$vo.id}">修改</a> | <a href="javascript:openpanel('del',{$vo['id']})">删除</a></td>
                        </tr>
                    </volist>
                </table>
            </div>
            <div class="lm_table_bottom">
                <div class="lm_table_bottom_l">
                    <em>
                        <div class="select_btn"><input type="button" class="select_btn1" onclick="selAll()" value=""/>&nbsp;&nbsp;<input type="button" onclick="selRev()" class="select_btn2" value=""/></div>
                        <div class="page">{$page}</div>
                        <div class="clear"></div>
                    </em>
                </div>
            </div>
        </div>
        <!--样式二 end-->
    </div>
    <!--主体区域 end-->
</div>
<!--右侧区域  end-->

<!--弹出层二begin-->
<div class="popupPanel">
    <div class="stats">
        <div class="lm_title">
            <div class="lm_title_l"><em id="panelTitle">做什么？</em></div>
        </div>
        <div class="lm_content">
            <table class="Zebra_Form" style="width:100%;">
                <tr class="row">
                    <td width="60"><label>已选ID：</label></td>
                    <input type="hidden" id="controlitems" value=""></input>
                    <input type="hidden" id="panelaction" value=""></input>
                    <td colspan="2" id="checked_items"><label style="color:#FF00AE;"></label></td>
                </tr>

                <tr class="row">
                    <td></td>
                    <td><input type="button" onclick="panelDo()" class="button" value="确定"/></td>
                    <td><input type="button" class="button" onclick="panelClose()" value="取消"/></td>
                </tr>
            </table>
        </div>
        <div class="lm_bottom">
            <div class="lm_bottom_l"><em></em></div>
        </div>
    </div>
</div>
<!--弹出层二end-->
</body>
<script>
    /**
     *添加新内容
     */
    function addcontent() {
        location = "__GROUP__/ad/add";
    }

    //开启panel窗口
    function openpanel(act, item) {
        //初始化关闭所有附加panel
        if (item === undefined || typeof(item) == 'undefined') {
            item = getSelects();
        }

        if (item == '') {
            jl_notify(3, "你没有选中任何项！");
            return;
        }

        $("#controlitems").val(item);
        $('#checked_items label').text(item);
        if (act == 'del') {
            $("#panelTitle").text("你确定要删除这些内容？");
            $("#panelaction").val("del");
            var obj = $('.popupPanel');
            jl_fadeIn(obj);
        } else {
            jl_notify(3, "不知道你到底要干什么！");
            return;
        }

    }

    //关闭panel窗口
    function panelClose() {
        var obj = $('.popupPanel');
        jl_fadeOut(obj);
    }

    //panel执行操作
    function panelDo() {
        var act = $("#panelaction").val();
        if (act == '') {
            jl_notify(3, "不知道你到底要干什么！");
            return;
        }
        if (act == 'del') {
            jl_fadeOut($('.popupPanel'));
            var items = $("#controlitems").val();
            $.post("__GROUP__/ajax/delCommon", {items: items, table: 'ad'}, function (data) {

                if (data == -1) {
                    jl_notify(2, "呜呜，删除这些广告失败！");
                } else if (data == 1) {
                    //jl_notify(1,"嘻嘻，删除栏目成功！");
                    location.href = location.href;
                } else {
                    jl_notify(2, "呜呜，种种原因导致删除这些广告失败！");
                }

            })
        } else {
            jl_notify(3, "不知道你到底要干什么！");
            return;
        }
    }
</script>
</html>